package org.openkoala.koala.deploy.pojo;

import java.util.ArrayList;
import java.util.List;
/**
 * 本地或远程
 * @author lingen
 *
 */
public class LocalRemoteTree implements Itree {
	private String name;

	private List<Itree> children = new ArrayList<Itree>();
	
	private boolean check;
	
	private LocalRemoteTree(String name){
		this.name = name;
		this.check = true;
	}
	
	public static LocalRemoteTree createLocalTreeNode(){
		return new LocalRemoteTree("local");
	}
	
	public static LocalRemoteTree createRemoteTreeNode(){
		return new LocalRemoteTree("remote");
	}
	
	public static LocalRemoteTree createWebServiceTreeNode(){
		return new LocalRemoteTree("webService");
	}
	
	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public void setChildren(List Children) {
		this.children = Children;
	}

	@Override
	public List getChildren() {
		if(children==null)children = new ArrayList();
		return children;
	}

	@Override
	public boolean isCheck() {
		return check;
	}

	@Override
	public void setCheck(boolean check) {
		this.check = check;
	}
}
